
const { result } = require('lodash');
const MyPromise = require('./myPromise');
const myPromise=require('./myPromise');

function pa(){
  return new myPromise((resolve,rejected)=>{
    setTimeout(()=>{
      resolve('pa')
    },2000)
  })
}
function pb(){
  return new myPromise((resolve,rejected)=>{
    // resolve('pb resolve')
    rejected('pb rejected')
  })
}
// pb().finally(()=>{
//   console.log('finally')
//   return pa()
// }).then(value=>{
//   console.log(value)
// },reason=>{
//   console.log(reason)

// })
pb().then(value=>console.log(value)).catch(reason=>console.log(reason))